﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Visible.aspx.cs" Inherits="Views_Visible" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> 
    <script type="text/javascript" src="../ViewModels/Visible.js"></script>
</asp:Content>
   
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h3>Visible</h3>
    <span>The visible binding causes the associated DOM element to become hidden or visible according to the value you pass to the binding.</span>
 
    <div>
        <div class="code">
<xmp>
<span data-bind="visible: myText">
This First line is visible between 10:00 AM and 12:00 PM
</span>    

<span data-bind="visible: (new Date().getHours() <= 10 ||
                 new Date().getHours() >= 12) ? true : false">
This Second line is not visible between 10:00 AM to 12:00 PM. 
</span>

</xmp>
        </div>
        <h4>Result</h4>
        <span data-bind="visible: myText">
            This First line is visible between 10:00 AM and 12:00 PM
        </span>    
        <span data-bind="visible: (new Date().getHours() <= 10 || new Date().getHours() >= 12) ? true : false">
            This Second line is not visible between 10:00 AM to 12:00 PM. 
        </span>            
    </div>
</asp:Content>

